﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Data.EntityClient;
using Classes;

namespace Model
{
    public class EF4LazyLoadingModel : ObjectContext
    {
        public EF4LazyLoadingModel(EntityConnection entityConnection)
            : base(entityConnection)
        {
            DefaultContainerName = "EF4LazyLoadingModel";
        }

        //IObject é uma interface que que possui os métodos necessários para o CRUD
        public IObjectSet<Person> People
        {
            get { return base.CreateObjectSet<Person>(); }
        }

        public IObjectSet<Contact> Contacts
        {
            get { return base.CreateObjectSet<Contact>(); }
        }
    }
}
